package com.ostrich.a2104gao5.test20

/**
 * @Author : yaotianxue
 * @Time : On 2023/10/17 10:17
 * @Description : Test20
 * object对象表达式===java匿名内部类
 */
fun main(){
    val callBack = object : CallBack{
        override fun ok() {
            println("ok")
        }
        override fun error() {
            println("error")
        }
    }

    test(callBack)
}

fun test(callBack: CallBack){
    callBack.ok()
}